{extend name="common/base"}
{block name="content"}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title  am-cf">会员列表</div>


                </div>
                <div class="widget-body  am-fr">

                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <!--<button type="button" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</button>-->
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-6">
                        <form action="{:url('index')}">
                        <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                            <input type="text" class="am-form-field " name="search">
                            <span class="am-input-group-btn">
                                <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="submit"></button>
                             </span>
                        </div>
                        </form>
                    </div>

                    <div class="am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                            <thead>
                            <tr>
                                <th>会员名称</th>
                                <th>手机</th>
                                <th>身份证</th>
                                <th>银行卡号</th>
                                <th>芝麻分</th>
                                <th>是否有信用卡</th>
                                <th>是否有社保</th>
                                <th>是否有公积金</th>
                                <th>是否有车</th>
                                <th>是否有房产</th>
                                <th>额度</th>
                            </tr>
                            </thead>
                            <tbody id="ajax-wrapper">

                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr ajax-page">
                            {$page}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="footer-js"}
<script src="__ADMIN__/template.js"></script>
<script id="ajax-content" type="text/html">
    <%for(var i = 0 ; i<data.length; i++) {%>
    <tr>
        <td><%=data[i].name%></td>
        <td><%=data[i].phone%></td>
        <td><%=data[i].certificate%></td>
        <td><%=data[i].card%></td>

        <td><%=data[i].creditcard%></td>
        <td><%=data[i].sesame%></td>
        <td><%=data[i].accumulation%></td>
        <td><%=data[i].social%></td>
        <td><%=data[i].vehicle%></td>
        <td><%=data[i].room%></td>
        <td><%=data[i].quotas%></td>
    </tr>
    <%}%>
</script>
<script>
    var config = {
        success : function (res) {
            console.log(res)
            var html = template($('#ajax-content').html() , {data:res.ad_list.data})

            $('#ajax-wrapper').html(html)
            $('.ajax-page').html(res.page)
        }
    };
    $.ajax(config);
    $('.ajax-page').on('click' , 'a' , function (e) {
        e.preventDefault();
        var url = $(this).attr('href');
        config.url = url;
        $.ajax(config);
    })

</script>
{/block}